#include "app_device.h"
#include "app_blue.h"
#include "unistd.h"

int main(int argc, char const *argv[])
{

    /* 1.设备初始化 */

    Device *device = app_device_init("/home/cs/桌面/gateway/serial");
    if (device == NULL)
    {
        log_error("app_device_init failed");
    }
    log_debug("app_device_init");

    if (app_blue_init(device) == SUCCESS)
    {
        log_debug("app_blue_init success");
    }

    /* 2.启动设备 */
    if (app_device_start(device) == SUCCESS)
    {
        log_debug("app_device_start success");
    }

    sleep(1000);

    /* 3.free空间 */
    if (app_device_stop(device) == SUCCESS)
    {
        log_debug("app_device_stop success");
    }

    return 0;
}
